// $Id: heapmanager.h,v 1.5 2006-10-23 18:49:41 nicolasw Exp $
#ifndef HEAPMANAGER_H
#define HEAPMANAGER_H

#include <stddef.h>
#include <stdbool.h>

typedef enum {FirstFit, BestFit, BadFit, NextFit} policy_t; 
typedef struct heapmanager_s heapmanager_s;

// Constructor y destructor
heapmanager_s *hm_create(void *offset, size_t mem_size, size_t block_size, policy_t policy);
void hm_destroy(heapmanager_s *this);

// Mutadores
void *hm_malloc(heapmanager_s *this, size_t size);
size_t hm_free(heapmanager_s *this, void *vtag);

// Proyectores
void *hm_offset(const heapmanager_s *this);
size_t hm_mem_size(const heapmanager_s *this);
size_t hm_block_size(const heapmanager_s *this);
policy_t hm_policy(const heapmanager_s *this);
size_t hm_mem_free(const heapmanager_s *this);

#endif /* HEAPMANAGER_H */
